﻿using DataModels.Enums.OfflineStore;
using SqlSugar;
using static DataModels.Enums.GeneralEnum;

namespace DataModels.Entities.OfflineStore
{
    [SugarTable]
    public class OfflineStoreOrder
    {
        [SugarColumn(IsPrimaryKey = true)]
        public Guid UUID { get; set; } = Guid.NewGuid();

        /// <summary>
        /// 总订单UUID
        /// </summary>
        public Guid OfflineStoreOrderTotalUUID { get; set; }

        /// <summary>   
        /// 订单编号
        /// </summary>
        public string OrderNo { get; set; } = Utils.MicrosecondTimeStamp.GenerateUniqueId();

        /// <summary>
        /// 商品UUID
        /// </summary>
        public Guid OfflineStoreProductUUID { get; set; }

        /// <summary>
        /// 订单金额
        /// </summary>
        public decimal OrderAmount { get; set; }

        /// <summary>
        /// 支付金额
        /// </summary>
        public decimal PayAmount { get; set; }

        /// <summary>
        /// 优惠金额
        /// </summary>
        public decimal DiscountAmount { get; set; } = 0;

        /// <summary>
        /// 优惠券UUID
        /// </summary>
        public Guid? PaymentCouponMapUUID { get; set; }

        /// <summary>
        /// 订单状态
        /// </summary>
        public OfflineStoreOrderStatus OrderStatus { get; set; } = OfflineStoreOrderStatus.PendingPayment;

        /// <summary>
        /// 删除标记
        /// </summary>
        public Status IsDeleted { get; set; } = Status.Disable;

        public DateTime CreateTime { get; set; } = DateTime.Now;
        public DateTime? UpdateTime { get; set; }

        public Guid CreateUserUUID { get; set; }

        public Guid? UpdateUserUUID { get; set; }
    }
}
